import axios from 'axios';
import { req } from './axiosFun';

/**
 * 采购管理
 */
//获取采购计划列表
export const CaiGouPlanList = (params) => { return req("get", "/api/ProcurementPlan", params) };
//获取单个采购计划
export const CaiGouPlan = (params) => { return req("get", "/api/ProcurementPlan/" + params) };
//获取采购计划详情列表
export const CaiGouPlanDetails = (params) => { return req("post", "/api/CaiGouPlanDetails/GetPlanDetailList?id=" + params) };

/**
 * 审核
 */
//获取审核的

//审核通过
export const Approve = (params) => {
    return req("put", "/api/AuditLogging", params)
}
// 审核- 添加审核记录
export const AddAuditLogging = (params) => { return req("post", "/api/AuditLogging", params) };
//审核- 获取需要审核的列表
export const GetAuditLoggingList = (params) => { return req("post", "/api/AuditLogging/getAudit", params) };

/**
 * 商品管理
 */
// 商品管理-获取商品列表
export const GoodsList = (params) => { return req("get", "/api/CommodityManagement", params) };
// 商品管理-获取单个商品
export const Good = (params) => { return req("get", "/api/CommodityManagement/" + params, params) };
// 商品管理-保存商品管理
export const GoodsSave = (params) => { return req("post", "/api/CommodityManagement", params) };
// 商品管理-删除商品管理
export const GoodsDelete = (params) => { return axios.delete("/api/Goods/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
//获取商品的类型
export const GoodsTypeList = (params) => { return req("get", "/api/GoodsTypes", params) };

//仓库管理  -获取仓库列表
export const CinfoList = (params) => { return req("get", "/api/Cinfo") }

//获取供应商列表
export const SupplierList = (params) => { return req("get", "/api/Suppliers") }

//获取已审核的采购计划列表
export const ImportPlanList = (params) => { return req("get", "/api/ProcurementPlan/GetPlan") }


//用户列表
export const userList = (params) => { return req("get", "/api/UserInfo", params) };

//添加采购订单
export const AddCaiGouOrder = (params) => { return req("post", "/api/CaigouOrders", params) };

//获取采购订单
export const CaiGouOrderList = (params) => { return req("post", "/api/CaigouOrders/GetData", params) };
//获取单个采购订单
export const CaiGouOrder = (params) => { return req("get", "/api/CaigouOrders/" + params) };


//删除采购订单
export const DeleteCaigouOrder = (params) => { return req("delete", "/api/CaigouOrders/" + params) };
//修改采购订单
export const UpdateCaigouOrder = (param1,param2) => { return req("put", "/api/CaigouOrders/" + param1, param2) };



//获取采购入库Data
export const CaigouEnters = (params) => { return req("get", "/api/CaigouEnters/" + params) };
//获取采购入库list
export const CaigouEntersList = (params) => { return req("get", "/api/CaigouEnters" , params) };
//获取审核通过的采购订单
export const GetAuditedCaiGouOrderList = (params) => { return req("post", "/api/CaigouOrders/GetAuditedCaiGouOrder", params) };

//增加采购入库记录
export const AddCaigouEnter = (params) => { return req("post", "/api/CaigouEnters", params) };

//获取多个采购订单的采购明细
export const GetCaigouOrderDetailList = (params) => { return req("get", "/api/CaiGouOrderDetails/"+ params) };


//添加采购退货
export const CaiGouReturned = (params) => { return req("post", "/api/CaigouReturneds", params) };
//获取采购退货list
export const CaiGouReturnedList = (params) => { return req("get", "/api/CaigouReturneds", params) };

//获取应付款文件
export const CaigouDuepaysList = (params) => { return req("get", "/api/CaigouDuepays", params) };

//添加应付款
export const AddCaigouDuepays = (params) => { return req("post", "/api/CaigouDuepays", params) };

















